﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CardSell.aspx.cs" Inherits="System_RPT_CardSell" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.1" Namespace="DevExpress.Web.ASPxGridView"
    TagPrefix="dxwgv" %>
<%@ Register TagPrefix="dxcb" Assembly="DevExpress.Web.v10.1" Namespace="DevExpress.Web.ASPxCallback" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.1" Namespace="DevExpress.Web.ASPxEditors"
    TagPrefix="dxe" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>充值卡列表</title>
    <base target="_self" />
    <link rel="stylesheet" type="text/css" href="../css/main.css" />
    <script type="text/javascript" src="../../Scripts/jquery-1.4.1.js"></script>
    <script type="text/javascript">

        function gridCustomButtonClick(s, e) {
            if (e.buttonID == 'Edit') {
                s.GetRowValues(e.visibleIndex, "PRODUCTID", OnGetRowEdit);
            }
            if (e.buttonID == 'Query') {
                s.GetRowValues(e.visibleIndex, "PRODUCTID", OnGetRowQuery);
            }
            if (e.buttonID == 'Select') {
                s.GetRowValues(e.visibleIndex, "PRODUCTID", OnGetRowValues);
            }
        }

        function OnGetRowValues(values) {
            if (values.length == 0) {
                alert("请先选择行");
                return;
            }
            else {
                window.returnValue = values;
                window.close();
            }

        }


        function OnGetRowEdit(selectedValues) {
            if (selectedValues.length != 0) {
                var myArguments = "resizable:yes;scroll:yes;status:no;dialogWidth=800px;dialogHeight=800px;center=yes;help=no";
                var querystring = "Product.aspx?pagemode=update&time=" + new Date() + "&ProductID=" + selectedValues;
                var result = window.showModalDialog(querystring, self, myArguments);
                if (result == "ok") {
                    var result = $("#<%=btnQuery.ClientID%>");
                    result[0].click();
                }
            }
        }

        function OnGetRowQuery(selectedValues) {
            if (selectedValues.length != 0) {
                var myArguments = "resizable:yes;scroll:yes;status:no;dialogWidth=800px;dialogHeight=800px;center=yes;help=no";
                var querystring = "Product.aspx?pagemode=query&time=" + new Date() + "&ProductID=" + selectedValues;
                var result = window.showModalDialog(querystring, self, myArguments);
                if (result == "ok") {
                    var result = $("#<%=btnQuery.ClientID%>");
                    result[0].click();
                }
            }
        }
        function getTheSelectedRowsValuesSelect(selectedValues) {
            gridSearchResult.GetSelectedFieldValues("PRODUCTID", getTheSelectedRowsValues);
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="maindiv">
        <div id="form">
            <fieldset>
                <legend>查询</legend>
                <div>
                    <table width="100%">
                        <tbody>
                            <tr>
                                <td align="right" style="width: 10%">
                                    商品编号：
                                </td>
                                <td align="left" style="width: 20%">
                                    <dxe:ASPxTextBox ID="txtProductId" runat="server" Width="195px">
                                    </dxe:ASPxTextBox>
                                </td>
                                <td align="right" style="width: 10%">
                                    商品名称：
                                </td>
                                <td align="left" style="width: 20%">
                                    <dxe:ASPxTextBox ID="txtPRODUCTNAME" CssClass="textbox" runat="server" Width="125px">
                                    </dxe:ASPxTextBox>
                                </td>
                                <td align="right" style="width: 10%">
                                    商品类别：
                                </td>
                                <td align="left">
                                    <dxe:ASPxComboBox ID="ddlCATEGORYID" runat="server" CssClass="select" Width="125px">
                                        <Items>
                                        </Items>
                                    </dxe:ASPxComboBox>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" style="width: 10%">
                                    所在学校：
                                </td>
                                <td align="left">
                                    <dxe:ASPxComboBox ID="ddlSCHOOLID" runat="server" CssClass="select" Width="195px">
                                        <Items>
                                        </Items>
                                    </dxe:ASPxComboBox>
                                </td>
                                <td align="right" style="width: 10%">
                                    带 宽：
                                </td>
                                <td align="left" style="width: 20%">
                                    <dxe:ASPxComboBox ID="ddlBANDWIDTH" runat="server" CssClass="select" Width="125px"
                                        ClientInstanceName="ddlBANDWIDTH" DropDownStyle="DropDownList">
                                    </dxe:ASPxComboBox>
                                </td>
                                <td align="right" style="width: 10%">
                                    使用期限：
                                </td>
                                <td align="left" style="width: 20%">
                                    <dxe:ASPxComboBox ID="ddlLIFETIME" runat="server" CssClass="select" Width="125px">
                                        <Items>
                                        </Items>
                                    </dxe:ASPxComboBox>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" style="width: 10%">
                                    订单日期：
                                </td>
                                <td align="left">
                                   <div>
                                        <div style="float: left; clear: none;">
                                            <dxe:ASPxDateEdit ID="txtORDERDATE_START" runat="server" Width="90px">
                                            </dxe:ASPxDateEdit>
                                        </div>
                                        <div style="float: left; clear: none; width: 15px;">
                                            &nbsp;~
                                        </div>
                                        <div style="float: left; clear: none;">
                                            <dxe:ASPxDateEdit ID="txtORDERDATE_END"  runat="server" Width="90px">
                                            </dxe:ASPxDateEdit>
                                        </div>
                                    </div>
                                </td>
                                <td align="right" style="width: 10%">
                                </td>
                                <td align="left" style="width: 20%">
                                    
                                </td>
                                <td align="right" style="width: 10%">
                                </td>
                                <td align="left" style="width: 20%">
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </fieldset>
        </div>
        <div class="clear">
        </div>
        <div class="toolbar">
            <div>
                <div style="float: left;">
                </div>
                <div style="width: 5px; float: left;">
                </div>
                <div style="float: right;">
                    <dxe:ASPxButton ID="btnExcel" runat="server" Text="导出" AutoPostBack="False" Width="55px"
                        Height="16px" Image-Url="../images/exl.gif" Paddings-Padding="0px" FocusRectPaddings-Padding="0px">
                    </dxe:ASPxButton>
                </div>
                <div style="width: 5px; float: right;">
                    &nbsp
                </div>
                <div style="float: right;">
                    <dxe:ASPxButton ID="btnQuery" runat="server" Text="查询" AutoPostBack="False" Width="55px"
                        Height="16px" Paddings-Padding="0px" Image-Url="" OnClick="btnQuery_Click" FocusRectPaddings-Padding="0px">
                    </dxe:ASPxButton>
                </div>
            </div>
        </div>
        <div class="clear">
        </div>
        <div>
            <table cellspacing="0" cellpadding="5" width="100%" border="0">
                <tr>
                    <td>
                        <dxwgv:ASPxGridView ID="gridSearchResult" ClientInstanceName="gridSearchResult" runat="server"
                            KeyFieldName="PRODUCTID" AutoGenerateColumns="False" Settings-ShowFooter="true"
                            OnRowDeleting="gridSearchResult_RowDeleting" SettingsPager-AlwaysShowPager="true"
                            Width="100%">
                            <Styles>
                                <GroupPanel HorizontalAlign="Left">
                                </GroupPanel>
                                <AlternatingRow Enabled="True">
                                </AlternatingRow>
                                <CommandColumn Paddings-Padding="1">
                                </CommandColumn>
                            </Styles>
                            <Columns>
                                <dxwgv:GridViewDataColumn FieldName="PRODUCTID" Caption="商品编号" />
                                <dxwgv:GridViewDataColumn FieldName="PRODUCTNAME" Caption="商品名称" />
                                <dxwgv:GridViewDataColumn FieldName="QUANTITY" Caption="商品数量" />
                                <dxwgv:GridViewDataTextColumn FieldName="UNITPRICE" Caption="平均单价">
                                    <PropertiesTextEdit DisplayFormatString="{0:N2}">
                                    </PropertiesTextEdit>
                                </dxwgv:GridViewDataTextColumn>
                                <dxwgv:GridViewDataTextColumn FieldName="FEE" Caption="总金额">
                                    <PropertiesTextEdit DisplayFormatString="{0:N2}">
                                    </PropertiesTextEdit>
                                </dxwgv:GridViewDataTextColumn>
                                <dxwgv:GridViewDataTextColumn FieldName="PURCHASEPRICE" Caption="总进价">
                                    <PropertiesTextEdit DisplayFormatString="{0:N2}">
                                    </PropertiesTextEdit>
                                </dxwgv:GridViewDataTextColumn>
                                <dxwgv:GridViewDataTextColumn FieldName="MARKETPRICE" Caption="总市场价">
                                    <PropertiesTextEdit DisplayFormatString="{0:N2}">
                                    </PropertiesTextEdit>
                                </dxwgv:GridViewDataTextColumn>
                                <dxwgv:GridViewDataColumn FieldName="SCHOOLNAME" Caption="学校" />
                                <dxwgv:GridViewDataColumn FieldName="BANDWIDTHNAME" Caption="带宽" />
                                <dxwgv:GridViewDataColumn FieldName="LIFETIMENAME" Caption="使用期限" />
                                <dxwgv:GridViewDataColumn FieldName="CATEGORYNAME" Caption="商品类别" />
                            </Columns>
                            <Settings ShowGroupPanel="True" ShowFooter="True" ShowGroupFooter="VisibleAlways"
                                ShowHorizontalScrollBar="false" ShowVerticalScrollBar="false" />
                            <SettingsBehavior AllowDragDrop="true" AllowGroup="true" AutoExpandAllGroups="true"
                                ConfirmDelete="true" AllowFocusedRow="true" />
                            <SettingsText ConfirmDelete="确定要删除吗？" />
                            <GroupSummary>
                                <dxwgv:ASPxSummaryItem DisplayFormat="总数量：{0}" FieldName="ITEMCOUNT" SummaryType="Sum"
                                    ShowInGroupFooterColumn="ITEMCOUNT" />
                                <dxwgv:ASPxSummaryItem DisplayFormat="总金额：{0:N2}" FieldName="SUMMONEY" SummaryType="Sum"
                                    ShowInGroupFooterColumn="SUMMONEY" />
                            </GroupSummary>
                            <TotalSummary>
                                <dxwgv:ASPxSummaryItem DisplayFormat="总数量：{0}" FieldName="ITEMCOUNT" SummaryType="Sum"
                                    ShowInColumn="ITEMCOUNT" />
                                <dxwgv:ASPxSummaryItem DisplayFormat="总金额：{0:N2}" FieldName="SUMMONEY" SummaryType="Sum"
                                    ShowInColumn="SUMMONEY" />
                            </TotalSummary>
                            <SettingsPager PageSize="10" Mode="ShowPager" SEOFriendly="Enabled" Position="Bottom"
                                Summary-Visible="true">
                                <Summary AllPagesText="分页{0} - {1} (总{2}条)" Text="当前第{0}页，共{1}页 (共{2}条记录)" />
                            </SettingsPager>
                        </dxwgv:ASPxGridView>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    </form>
</body>
</html>
